#include "testNotification.h"
#include <QDebug>
#include "testSendData.h"
 #include "..\GlobalNotification\GlobalNotification.h"

testNotification::testNotification(QWidget *parent)
    : QWidget(parent)
{
    ui.setupUi(this);
     GlobalNotification::defaultCenter()->addObserver(this, SLOT(onNotification(const QString&, const QObject*, const QVariantMap&)), "hello");
     testSendData *sendData = new testSendData(this);
}

testNotification::~testNotification()
{


}

void testNotification::onNotification(const QString& name, const QObject* sender,  QVariantMap* userInfo)
{
    if (name == "hello")
    {
        qDebug() << "userInfoValue:" << userInfo->value("hello").toString();
        userInfo->insert("hello", "success");
    }

}

